package com.jdzy.student.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jdzy.model.student.pojos.StudentBaseInformation;
import com.jdzy.student.mapper.StudentBaseInformationMapper;
import com.jdzy.student.service.StudentBaseInformationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class StudentBaseInformationServiceImpl extends ServiceImpl<StudentBaseInformationMapper, StudentBaseInformation> implements StudentBaseInformationService {
    @Autowired
    private StudentBaseInformationMapper studentBaseInformationMapper;

    @Override
    public void updateAvatar(String stuId, String avatarUrl) {
        UpdateWrapper<StudentBaseInformation> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("stu_id", stuId);
        StudentBaseInformation studentBaseInformation = new StudentBaseInformation();
        studentBaseInformation.setAvatar(avatarUrl);
        studentBaseInformationMapper.update(studentBaseInformation, updateWrapper);
    }
}
